<?php

require_once 'phing/BuildListener.php';

class PhingScreenLogger implements BuildListener {
	
	private $ignoredLines = array (
		"+Task: warn",
		"+Task: echo",
		"+Task: phing",
		"+Task: property",
		"+Task: phingcall"
	);  
	
	
	
    public function buildStarted(BuildEvent $event) {
    	 echo "<pre>";
    }

    public function buildFinished(BuildEvent $event) {
    	echo "</pre>";
   	}

    public function targetStarted(BuildEvent $event) {}

    public function targetFinished(BuildEvent $event) {}

    public function taskStarted(BuildEvent $event) {}

    public function taskFinished(BuildEvent $event) {}

    public function setMessageOutputLevel() {}
	public function setOutputStream() {}
	public function setErrorStream() {}
    
    public function messageLogged(BuildEvent $event) {
    	$msg = $event->getMessage();
    	
		foreach ($this->ignoredLines as $line) {
			if (trim($msg) === trim($line)) {
				return;    	
			}
		}
    	
        echo "$msg<br/>";
        
    }
}

